package cn.melonlib.cores.commons.comp.utils;

import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.query.NativeQuery;
import javax.persistence.Query;

import java.io.Serializable;
import java.util.List;

public class HibernateQlParamsTool {
    public static void setQueryParam(Query query, List<? extends Object> params){
        for (int i = 0; i < params.size(); i++) {
            Object param=params.get(i);
            int p=i+1;
            query.setParameter(p, param);
        }
    }
}
